import Vue from 'vue'
import Router from 'vue-router'

import Home from '@/components/Home.vue'
import Member from '@/components/Member.vue'
import Shopcar from '@/components/Shopcar.vue'
import Search from '@/components/Search.vue'
import NewsList from '@/components/news/NewsList.vue'

Vue.use(Router)

export default new Router({
  // 设置被激活路由自动添加的类名, 默认类名为router-link-active
  linkActiveClass: 'mui-active',
  // linkExtraActiveClass适用于不止一个类名时设置额外的类名
  routes: [
    // 配置路由规则
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/member',
      component: Member
    },
    {
      path: '/shopcar',
      component: Shopcar
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/newslist',
      component: NewsList
    }
  ]
})
